module Main where

main::IO()
main = do
	n<-readLn
	s<-readLn
	print(p n s)
	
fl:: [Int]
fl = fl1 1 1 1 
	where fl1 x y z = x:fl1 y z (x+y+z)
	
p :: [Int] -> Int -> Int
p [] _ = error "Out of Bounds"
p (x:xs) i = if i==1 then x else p xs (i-1)